home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Hardware / AV Tools / VUMeters / Sources / ARTA Includes / DSPManager.h < prev    next >
Encoding:
Text File  |  1993-10-27  |  29.3 KB  |  631 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        DSPManager.h
  3.  
  4.     Copyright:    © 1990-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6. */
  7.  
  8. //======================================================================================
  9. #ifndef __DSPManager__
  10. #define __DSPManager__
  11. #include <types.h>
  12.  
  13. //--------------------------------------------------------------------------------------
  14. // DSPManager Version Number
  15. //
  16. // 0x09     changes DSPNewTask & DSPInsertTask
  17. // 0x0A HBS DSPIODevice calls now require a iopbDeviceType to be passed in the parameter
  18. //            block
  19. // 0x0B APS Changed DSPModule Structure
  20. // 0x0C APS FIFO API changed.
  21. // 0x0D    APS    FIFO API Changed again (Linked FIFOs Rev. 4)
  22. //--------------------------------------------------------------------------------------
  23. #define kdspManagerBuildVersion        0x0000000D
  24.  
  25. //======================================================================================
  26. //                             N E W  D A T A  T Y P E S
  27. //======================================================================================
  28. typedef unsigned long    DSPPosition;            // type for position parameter
  29. typedef unsigned long     DSPCycles;                // type for processing bandwidth
  30. typedef unsigned long    DSPClientRefNum;        // type for DSPClient reference number
  31. typedef unsigned long    DSPIODeviceRefNum;        // type for DSPIODevice reference number
  32. typedef unsigned long    DSPCPUDeviceRefNum;        // type for DSPCPUDevice reference number
  33. typedef unsigned long    DSPTaskRefNum;            // type for DSPTask reference number
  34. typedef unsigned long    DSPModuleRefNum;        // type for DSPModule reference number
  35. typedef unsigned long    DSPSectionRefNum;        // type for DSPSection reference number
  36. typedef unsigned long    DSPFIFORefNum;            // type for DSPFIFO reference number
  37. typedef unsigned long    DSPLinkedFIFORefNum;    // type for DSPLinkedFIFO reference number
  38. typedef unsigned long    DSPSynchRefNum;            // type for TaskToSynch and SynchTasks reference number
  39. typedef pascal void (*MessageActionProc)(struct DSPMessage *theMessage);
  40.  
  41. enum DSPConnectionType {
  42.     kdspDirectConnection,
  43.     kdspIndirectConnection,
  44.     kdspHIHOConnection
  45. };
  46.  
  47. enum DSPTaskPriority {
  48.     kdspRealTime,
  49.     kdspTimeShare
  50. };
  51.  
  52. typedef enum { 
  53.     kdspTaskIsActive, 
  54.     kdspTaskIsInactive, 
  55.     kdspTaskIsGoingInactive, 
  56.     kdspTaskIsGoingActive, 
  57.     kdspInvalidTask 
  58. } DSPTaskStatus;
  59.  
  60. #ifndef __cplusplus
  61. typedef struct    DSPDeviceParamBlk        DSPDeviceParamBlk;
  62. typedef struct    DSPCPUDeviceParamBlk    DSPCPUDeviceParamBlk;
  63. typedef struct    DSPIODeviceParamBlk        DSPIODeviceParamBlk;
  64. typedef struct    DSPBIODeviceParamBlk    DSPBIODeviceParamBlk;
  65. typedef    struct    DSPSIODeviceParamBlk    DSPSIODeviceParamBlk;
  66. typedef struct    DSPFIFO                    DSPFIFO;
  67. typedef struct    DSPFIFOAddress            DSPFIFOAddress;
  68. typedef struct    DSPMessage                DSPMessage;
  69. typedef struct    DSPClientInfoParamBlk    DSPClientInfoParamBlk;
  70. typedef struct    DSPTaskInfoParamBlk        DSPTaskInfoParamBlk;
  71. typedef struct    DSPModuleInfoParamBlk    DSPModuleInfoParamBlk;
  72. typedef struct    DSPSectionInfoParamBlk    DSPSectionInfoParamBlk;
  73. typedef struct    DSPGPBModeIndicator        DSPGPBModeIndicator;
  74. typedef enum    DSPConnectionType        DSPConnectionType;
  75. typedef enum    DSPTaskPriority            DSPTaskPriority;
  76. #endif
  77.  
  78. //======================================================================================
  79. //                                 S T R U C T U R E S
  80. //======================================================================================
  81. //======================================================================================
  82. // DSPFIFOAddress
  83. //======================================================================================
  84. struct DSPFIFOAddress {
  85.     struct DSPFIFO *l;            // logical pointer
  86.     struct DSPFIFO *p;            // physical pointer
  87.     };
  88.  
  89. //======================================================================================
  90. // DSPParamBlkHeader
  91. //        this parameter block header is shared between the DSPIODeviceParamblock
  92. //        and the DSPCPUDeviceParamBlk. The reason we declare things this way is so that
  93. //        we can have routines that operate only on the common parts of the structures
  94. //        therefore making the code smaller, easier to write, easier to maintain, etc…
  95. //
  96. //        pbhDeviceIndex            the index for this device
  97. //        pbhClientPermission        read/write permission for this client
  98. //        pbhClientRefNum            the reference number for this client
  99. //        pbhClientName            the name of this client
  100. //        pbhDeviceName            the device name for the io or cpu device
  101. //        pbhDeviceICON            the device icon for the io or cpu device
  102. //
  103. //======================================================================================
  104. #define DSPDeviceParamBlkHeader\
  105.     unsigned short            pbhDeviceIndex;\
  106.     unsigned short            pbhClientPermission;\
  107.     DSPClientRefNum            pbhClientRefNum;\
  108.     Str31                    pbhClientName;\
  109.     Handle                    pbhClientICON;\
  110.     Str31                    pbhDeviceName;\
  111.     Handle                    pbhDeviceICON;
  112.  
  113. //======================================================================================
  114. // DSPDeviceParamBlk:
  115. //======================================================================================
  116. struct DSPDeviceParamBlk {
  117.     DSPDeviceParamBlkHeader
  118.     };
  119.  
  120. //======================================================================================
  121. // DSPCPUDeviceParamBlk:
  122. //        this parameter block is used for controlling a cpu device. It shares the
  123. //        DSPParamBlkHeader with the io device.
  124. //======================================================================================
  125. struct DSPCPUDeviceParamBlk {
  126.     DSPDeviceParamBlkHeader
  127.     unsigned char        cpuSlotNumber;            // the slot number the card is in
  128.     unsigned char        cpuProcessorNumber;        // the processor number, zero based
  129.     OSType                cpuProcessorType;        // the type of the processor
  130.     DSPCycles            cpuMaxCycles;            // max processor execution cycles per frame
  131.     DSPCycles            cpuAllocatedCycles;        // num cycles currently allocated
  132.     DSPCycles            cpuCurRealTimeLoading;    // num cycles used during the last frame
  133.     DSPCycles            cpuTimeShareLoading;    // num cycles it took for time share list
  134.     DSPCycles            cpuTimeShareFreq;        // how often the timeshare list is run
  135.     Fixed                cpuFrameRate;            // num frames per second for this cpu device
  136.     MessageActionProc    cpuClientMessageActionProc;
  137.     unsigned long        cpuClientRefCon;
  138.     };
  139.     
  140. //======================================================================================
  141. // DSPIODeviceParamBlk
  142. //        this parameter block is used for controlling a io device. It shares the 
  143. //        DSPParamBlkHeader with the cpu device.
  144. //======================================================================================
  145. struct DSPIODeviceParamBlk {
  146.     DSPDeviceParamBlkHeader
  147.     unsigned short            iopbIODeviceIndex;    // index of this io device
  148.     unsigned short            iopbIODeviceType;    // type of this io device
  149.     unsigned char            iopbReserved[32];    // data specific to the io device
  150.     };
  151.  
  152. struct DSPBIODeviceParamBlk {
  153.     DSPDeviceParamBlkHeader
  154.     unsigned short            iopbIODeviceIndex;    // index of this io device
  155.     unsigned short            iopbIODeviceType;    // type  of this io device
  156.     struct DSPMessage        *bioMessageHandler;    // gets called when state of bio pin changes
  157.     unsigned char            bioPinState;        // 0 level low, 1 = logic level high
  158.     unsigned char            bioPinDirection;    // 0 = input only, 1 = output only
  159.     unsigned char            bioPinIntEnable;    // 0 = interrupt masked, 1 = interrupt enabled
  160.     unsigned char            bioReserved[25];    // reserved space
  161.     };
  162.  
  163. struct DSPSIODeviceParamBlk {
  164.     DSPDeviceParamBlkHeader
  165.     unsigned short            iopbIODeviceIndex;    // index of this io device
  166.     unsigned short            iopbIODeviceType;    // type of this io device
  167.     Fixed                    sioSampleRate;        // sample rate for this io device, rate is for both input and output
  168.     unsigned long            sioSampleFormat;    // sample size for this io device, size is for both input and output
  169.     DSPFIFOAddress            sioInputFIFO;        // pass the physical pointer to your dsp code
  170.     DSPFIFOAddress            sioOutputFIFO;        // pass the physical pointer to your dsp code
  171.     unsigned char            sioDMAEnable;        // 0 = off, 1 = on, enables both input and output
  172.     unsigned char            sioFeatures;        // contains bit that indicates if it can be used for standard sound etc…
  173.     unsigned char            sioReserved[6];        // reserved space
  174.     };
  175.     
  176.  
  177. //======================================================================================
  178. // DSPBandwidth: is used to represent guaranteed processing bandwidth 
  179. // information.
  180. //======================================================================================
  181. struct DSPBandwidth {                            // bn = ba-ndwidth
  182.     DSPCycles                bnEstimate;            // worst case pre-runtime
  183.     DSPCycles                bnActual;            // worst case runtime
  184.     unsigned long            bnFlags;            // control flags
  185.     };
  186.  
  187.  
  188. //======================================================================================
  189. // DSPMessage: used for passing messages back and forth between the kernel and the driver.
  190. //======================================================================================
  191. struct DSPMessage {
  192.     MessageActionProc        msVector;            // vector of routine
  193.     unsigned long            msData[3];            // application specific data
  194.     };
  195.     
  196. //======================================================================================
  197. // DSPGPBModeIndicator: used for requesting more (or less) GPB when a module is running.
  198. //======================================================================================
  199. struct DSPGPBModeIndicator {
  200.     unsigned short        miCurrentMode;            // Mode in which the module is operating 
  201.                                                 // (only the DSP code should change this)
  202.     unsigned short        miNextMode;                // (only the DSP Manager should change this value)
  203.     };
  204.  
  205. //======================================================================================
  206. //  “G E T   I N F O”   M E S S A G E   P A R A M   B L O C K S
  207. //======================================================================================
  208. //--------------------------------------------------------------------------------------
  209. // DSPClientInfoParamBlk
  210. //        this parameter block is used for getting information on a client that is
  211. //        signed in to the DSPManager.
  212. //--------------------------------------------------------------------------------------
  213. struct DSPClientInfoParamBlk {
  214.     DSPClientRefNum            ciClientRefNum;        // Returned ref num of the client
  215.     unsigned short            ciClientPermission;    // Returned read/write permission of the client
  216.     Handle                    ciClientICON;        // Returned icon of the client
  217.     Str31                    ciClientName;        // Returned name of the client
  218.     };
  219.  
  220. //--------------------------------------------------------------------------------------
  221. // DSPTaskInfoParamBlk
  222. //        this parameter block is used for getting information on a task that is
  223. //        installed on the DSP.
  224. //--------------------------------------------------------------------------------------
  225. struct DSPTaskInfoParamBlk {
  226.     DSPTaskRefNum            tiRefNum;            // Returned reference number for this task
  227.     unsigned long            tiRefCon;            // Returned application specific long
  228.     MessageActionProc        tiVector;            // Returned Vector of task action proc
  229.     unsigned long            tiFlags;            // Returned flags for DSPTask control
  230.     Str31                    tiName;                // Returned name of this DSPTask
  231.     };
  232.  
  233. //--------------------------------------------------------------------------------------
  234. // DSPModuleInfoParamBlk
  235. //        this parameter block is used for getting information on a module that is
  236. //        installed on the DSP.
  237. //--------------------------------------------------------------------------------------
  238. struct DSPModuleInfoParamBlk {
  239.     DSPModuleRefNum            miRefNum;            // Returned reference number of this module
  240.     struct DSPBandwidth        miGPB;                // Returned guaranteed processing bandwidth
  241.     unsigned long            miFlags;            // Returned module flags
  242.     unsigned long            miNumSections;        // Returned number of sections in module
  243.     Str31                    miName;                // Returned name of DSPModule
  244.     unsigned long            miExecutions;        // Returned number of executions
  245.     unsigned long            miSkipCount;        // Returned number of modules to skip
  246.     };
  247.  
  248. //--------------------------------------------------------------------------------------
  249. // DSPSectionInfoParamBlk
  250. //        this parameter block is used for getting information on a section that is
  251. //        installed on the DSP.
  252. //--------------------------------------------------------------------------------------
  253. struct DSPSectionInfoParamBlk {
  254.     DSPSectionRefNum        siRefNum;            // Returned reference number for this section
  255.     unsigned long            siSize;                // Returned size of data in actual section
  256.     unsigned long            siFlags;            // Returned section flags
  257.     unsigned long            siType;                // Returned for section connection type checking
  258.     Str31                    siName;                // Returned name of this section
  259.     Ptr                        siPrimary;            // Returned current location of section data
  260.     Ptr                        siSecondary;        // Returned optional section data storage location
  261.     DSPSectionRefNum        siPrevSection;        // Returned Previous Connection
  262.     DSPSectionRefNum        siNextSection;        // Returned Next Connection
  263.     DSPFIFORefNum            siFIFORefNum;        // Returned RefNum of the FIFO
  264.     Ptr                        siPrimaryPhys;        // Returned current physical location of section data
  265.     Ptr                        siSecondaryPhys;    // Returned optional physical section data storage location
  266.     };
  267.     
  268.     
  269. //======================================================================================
  270. //                 A D D I T I O N A L  S T R U C T U R E  D A T A  T Y P E S 
  271. //======================================================================================
  272. typedef    DSPCPUDeviceParamBlk    *DSPCPUDeviceParamBlkPtr,    **DSPCPUDeviceParamBlkHandle;
  273. typedef    DSPIODeviceParamBlk        *DSPIODeviceParamBlkPtr,    **DSPIODeviceParamBlkHandle;
  274. typedef    DSPBIODeviceParamBlk    *DSPBIODeviceParamBlkPtr,    **DSPBIODeviceParamBlkHandle;
  275. typedef    DSPSIODeviceParamBlk    *DSPSIODeviceParamBlkPtr,    **DSPSIODeviceParamBlkHandle;
  276. typedef    DSPClientInfoParamBlk    *DSPClientInfoParamBlkPtr,    **DSPClientInfoParamBlkHandle;
  277. typedef    DSPTaskInfoParamBlk        *DSPTaskInfoParamBlkPtr,    **DSPTaskInfoParamBlkHandle;
  278. typedef    DSPModuleInfoParamBlk    *DSPModuleInfoParamBlkPtr,    **DSPModuleInfoParamBlkHandle;
  279. typedef    DSPSectionInfoParamBlk    *DSPSectionInfoParamBlkPtr,    **DSPSectionInfoParamBlkHandle;
  280. typedef DSPGPBModeIndicator        *DSPGPBModeIndicatorPtr,    **DSPGPBModeIndicatorHandle;
  281.  
  282. #ifndef __cplusplus
  283. typedef    DSPMessage                *DSPMessagePtr,            **DSPMessageHandle;
  284. #else
  285. typedef    unsigned long            *DSPMessagePtr,            **DSPMessageHandle;
  286. #endif
  287.  
  288. //======================================================================================
  289. //                     D S P  M A N A G E R  T R A P  D I S P A T C H E R
  290. //======================================================================================
  291. //======================================================================================
  292. // misc dispatcher constants & macros
  293. //======================================================================================
  294. #define    _DSPDispatch                        0xABF5
  295. #define    MOVEL                                0x303C
  296. #define    DSPDispatch(select)                    {MOVEL,select,_DSPDispatch};
  297.  
  298. //======================================================================================
  299. // dispatch selectors for external calls
  300. //======================================================================================
  301. #define kdspGetTrapAddress                    0
  302. #define kdspSetTrapAddress                    1
  303. #define kdspGetIndexedCPUDevice                2
  304. #define kdspOpenCPUDevice                    3
  305. #define kdspCloseCPUDevice                    4
  306. #define kdspGetIndexedCPUDeviceOption        5
  307. #define kdspSetIndexedCPUDeviceOption        6
  308. #define kdspGetIndexedIODevice                7
  309. #define kdspOpenIODevice                    8
  310. #define kdspCloseIODevice                    9
  311. #define kdspGetIndexedIODeviceOption        10
  312. #define kdspSetIndexedIODeviceOption        11
  313. #define kdspSignInCPUDevice                    12
  314. #define kdspSignOutCPUDevice                13
  315. #define kdspSignInIODevice                    14
  316. #define kdspSignOutIODevice                    15
  317. #define kdspLoadModule                        16
  318. #define kdspUnloadModule                    17
  319. #define kdspConnectSections                    18
  320. #define kdspNewInterTaskBuffer                19
  321. #define kdspNewTask                            20
  322. #define kdspDisposeTask                        21
  323. #define kdspInsertTask                        22
  324. #define kdspManagerVersion                    23
  325. #define kdspRemoveTask                        24
  326. #define kdspTaskToSynchronize                25
  327. #define kdspAddressInZone                    26            // 4/16/92 JDB. Ripped out SynchronizeDevice
  328. #define kdspSynchronizeTasks                27
  329. #define kdspSetTaskActive                    28
  330. #define kdspSetTaskInactive                    29
  331. #define kdspCreateZone                        30
  332. #define kdspNewAddress                        31
  333. #define kdspDisposeAddress                    32
  334. #define kdspGetAddressSize                    33
  335. #define kdspGetZoneSize                        34
  336. #define kdspGetAddress                        35
  337. #define kdspGetZone                            36
  338. #define kdspInsertDouble                    37
  339. #define kdspRemoveDouble                    38
  340. #define kdspInsertSingle                    39
  341. #define kdspRemoveSingle                    40
  342. #define kdspGetSection                        41
  343. #define kdspNewFIFO                            42
  344. #define kdspDisposeFIFO                        43
  345. #define kdspGetSectionData                    44
  346. #define kdspFIFORead                        45
  347. #define    kdspFIFOWrite                        46
  348. #define    kdspFIFOGetReadCount                47
  349. #define    kdspFIFOGetWriteCount                48
  350. #define    kdspFIFOGetSize                        49
  351. #define kdspCreateModule                    50
  352. #define kdspInsertModule                    51
  353. #define kdspDisposeModule                    52
  354. #define kdspRemoveModule                    53
  355. #define kdspGetClientZone                    54
  356. #define kdspNewStorage                        55
  357. #define kdspAllocateStorage                    56
  358. #define kdspUnreserveStorage                57
  359. #define kdspDeallocateStorage                58
  360. #define kdspDisposeStorage                    59
  361. #define kdspProcessMessages                    60
  362. #define kdspFIFOClearInterrupt                61
  363. #define kdspFIFOGetRefCon                    62
  364. #define kdspFIFOSetRefCon                    63
  365. #define kdspFIFOGetMessageMode                64
  366. #define kdspFIFOSetMessageMode                65
  367. #define kdspFIFOReset                        66
  368. #define kdspSetTaskRefCon                    67
  369. #define kdspGetTaskRefCon                    68
  370. #define kdspGetIndexedClient                69
  371. #define kdspGetIndexedTask                    70
  372. #define kdspGetOwnerClient                    71
  373. #define kdspGetIndexedModule                72
  374. #define kdspGetOwnerTask                    73
  375. #define kdspGetIndexedSection                74
  376. #define kdspGetOwnerModule                    75
  377. #define kdspGetClientInfo                    76
  378. #define kdspGetTaskInfo                        77
  379. #define kdspGetModuleInfo                    78
  380. #define kdspGetSectionInfo                    79
  381. #define kdspConnectITBSections                80
  382. #define kdspConnectTwoFIFOSections            81
  383. #define kdspConnectFIFOToAIAOSections        82
  384. #define kdspConnectFIFOSections                83
  385. #define kdspConnectRegularSections            84
  386. #define kdspAllocate                        85
  387. #define kdspUpdateCPUDeviceInfo                86
  388. #define    kdspDisposeOneFIFO                    87
  389. #define    kdspFIFOSwap                        88
  390. #define kdspCountModule                        89
  391. #define kdspDontCountModule                    90
  392. #define kdspSetSkipCount                    91
  393. #define kdspGetTaskStatus                    92
  394. #define kdspSetCPUDeviceBondage                93
  395. #define kdspFIFOGetMessageDispatch            94
  396. #define kdspUpdateGPBPrefFile                95
  397. #define kdspFIFOSetMessageThreshold            96
  398. #define kdspSetGPBMode                        97
  399. #define kdspDontUpdateGPBPrefs                98
  400. #define kdspUpdateGPBPreferenceFile            99
  401. #define kdspConnectHIHOSections                100
  402. #define kdspDisposeZone                        101
  403. #define kdspClientMessageDispatch            102
  404. #define kdspFIFOGetMessageActionProc        103
  405. #define kdspFIFOSetMessageActionProc        104
  406. #define kdspSetSystemTask                    105
  407. #define kdspGetAvailableOnChipMemory        106
  408. #define kdspSetSectionSize                    107
  409. #define kdspGetPtrSize                        108
  410. #define kdspAllocateDriverFIFO                109
  411. #define kdspDisposeDriverFIFO                110
  412. #define kdspPatchPrevAndNext                111
  413. #define kdspSetUpLowAndHighPointerFromTask    112
  414. #define kdspAllocateSharedSections            113
  415. #define kdspAllocateSection                    114
  416. #define kdspAllocateModule                    115
  417. #define kdspNewStorageSection                116
  418. #define kdspClientRefNumToDSPClientPtr        117
  419. #define kdspGetDeviceRefNum                    118
  420. #define kdspAddClient                        119
  421. #define kdspRemoveClient                    120
  422. #define kdspGetCPUDeviceGivenIndex            121
  423. #define kdspGetIODeviceGivenIndex            122
  424. #define kdspUpdateIODeviceParamBlk            123
  425. #define kdspGetTaskGivenSectionTable        124
  426. #define kdspGetExceptionNotification        125
  427. #define kdspCPUDeviceRefNumToDevicePtr        126
  428. #define kdspConfigureSlaveDevice            127
  429.  
  430. //•••••••••••• 128-255 are for Standard Sound •••••••••
  431.  
  432. #define kdspGetCPUDeviceGivenRefNum            256
  433. #define kdspGetIODeviceGivenRefNum            257
  434. #define kdspGetFIFOPtr                        258
  435. #define kdspGetMaxCycles                    259
  436. #define kdspGetUsedCycles                    260
  437. #define kdspCyclesInTask                    261
  438. #define kdspNewPhysicalPtr                    262
  439. #define kdspDisposePhysicalPtr                263
  440. #define kdspVMPresent                        264
  441. #define kdspGetDSPZone                        265
  442. #define kdspComputePhysical                    266
  443. #define kdspCleanUpZone                        267
  444. #define kdspLogicalToPhysical                268
  445. #define kdspSectionStructPtr2RefNum            269
  446. #define kdspSectionRefNum2StructPtr            270
  447. #define kdspAttachAddrFixups                271
  448. #define kdspTryToCacheVanillaProgram        272
  449. #define kdspConvertDSPFtoDSPModule            273
  450. #define kdspGetTaskPtr                        274
  451. #define kdspGetModulePtr                    275
  452. #define kdspGetSectionPtr                    276
  453. #define kdspCheckTask                        277
  454. #define kdspPatchOneAddress                    278
  455. #define kdspPatchAllAddresses                279
  456. #define kdspSetUpTask                        280
  457. #define kdspTaskGetMessageDispatch            281
  458. #define kdspGetOverrunNotification            282
  459. #define kdspCheckHIHOConnections            283
  460. #define kdspPowerManager                    284
  461. #define kdspConvertFrameRate                285
  462. #define kdspAllocateSegment                    286
  463. #define kdspLoadKernel                        287
  464. #define kdspConnectIndirectSections            288
  465. #define kdspGetGPBModes                        289
  466. #define kdspDeviceCall                        290
  467. #define kdspDriverCall                        291
  468. #define kdspGetResource                        292
  469. #define kdspCreateAliasToResfile            293
  470. #define kdspRebootCPUDevice                    294
  471. #define kdspLoadSlotDrivers                    295
  472. #define kdspGetTimeShareLoading                296
  473.  
  474. //======================================================================================
  475. // DSP Manager dispatched traps (external only)
  476. //======================================================================================
  477. pascal OSErr DSPGetIndexedCPUDevice (DSPCPUDeviceParamBlkPtr theCPUParamBlk)
  478.         = DSPDispatch(kdspGetIndexedCPUDevice)
  479. pascal OSErr DSPOpenCPUDevice (DSPCPUDeviceParamBlkPtr theCPUParamBlk)
  480.         = DSPDispatch(kdspOpenCPUDevice)
  481. pascal OSErr DSPCloseCPUDevice (DSPCPUDeviceParamBlkPtr theCPUParamBlk)
  482.         = DSPDispatch(kdspCloseCPUDevice)
  483. pascal OSErr DSPUpdateCPUDeviceInfo (DSPCPUDeviceParamBlkPtr theCPUParamBlk)
  484.         = DSPDispatch(kdspUpdateCPUDeviceInfo)
  485. pascal OSErr DSPGetIndexedCPUDeviceOption (DSPCPUDeviceParamBlkPtr theCPUParamBlk, 
  486.         unsigned short theOptionIndex, OSType theOptionType, unsigned long *theOption)
  487.         = DSPDispatch(kdspGetIndexedCPUDeviceOption)
  488. pascal OSErr DSPSetIndexedCPUDeviceOption (DSPCPUDeviceParamBlkPtr theCPUParamBlk, 
  489.         unsigned short theOptionIndex, OSType theOptionType)
  490.         = DSPDispatch(kdspSetIndexedCPUDeviceOption)
  491. pascal OSErr DSPGetIndexedIODevice (DSPIODeviceParamBlkPtr theIOParamBlk)
  492.         = DSPDispatch(kdspGetIndexedIODevice)
  493. pascal OSErr DSPOpenIODevice (DSPIODeviceParamBlkPtr theIOParamBlk)
  494.         = DSPDispatch(kdspOpenIODevice)
  495. pascal OSErr DSPCloseIODevice (DSPIODeviceParamBlkPtr theIOParamBlk)
  496.         = DSPDispatch(kdspCloseIODevice)
  497. pascal OSErr DSPGetIndexedIODeviceOption (DSPIODeviceParamBlkPtr theIOParamBlk, 
  498.         unsigned short theOptionIndex, OSType theOptionType, unsigned long *theOption)
  499.         = DSPDispatch(kdspGetIndexedIODeviceOption)
  500. pascal OSErr DSPSetIndexedIODeviceOption (DSPIODeviceParamBlkPtr theIOParamBlk, 
  501.         unsigned short theOptionIndex, OSType theOptionType)
  502.         = DSPDispatch(kdspSetIndexedIODeviceOption)
  503. pascal OSErr DSPLoadModule(    StringPtr theName, DSPTaskRefNum theTaskRefNum, 
  504.         DSPPosition thePosition, DSPModuleRefNum theReferenceModuleRefNum, 
  505.         DSPModuleRefNum *theNewModuleRefNum, long theScale )
  506.         = DSPDispatch(kdspLoadModule)
  507. pascal OSErr DSPUnloadModule( DSPTaskRefNum theTaskRefNum, 
  508.         DSPModuleRefNum theModuleRefNum )
  509.         = DSPDispatch(kdspUnloadModule)
  510. pascal OSErr DSPConnectSections ( DSPSectionRefNum sectionOneRefNum, 
  511.         DSPSectionRefNum sectionTwoRefNum, DSPConnectionType theConnectionType )
  512.         = DSPDispatch(kdspConnectSections)
  513. pascal OSErr DSPNewInterTaskBuffer ( DSPTaskRefNum theTaskRefNum, 
  514.         unsigned long theSize, unsigned short theDataType, 
  515.         Str31 theInterTaskBufferName, short bankPreference, 
  516.         DSPSectionRefNum *theReturnedSection )
  517.         = DSPDispatch(kdspNewInterTaskBuffer)
  518. pascal OSErr DSPNewTask( DSPCPUDeviceParamBlkPtr theCPUDevice, 
  519.         MessageActionProc theVector, StringPtr theTaskName, DSPTaskRefNum *theRefNum )
  520.         = DSPDispatch(kdspNewTask)
  521. pascal OSErr DSPDisposeTask( DSPTaskRefNum theTaskRefNum )
  522.         = DSPDispatch(kdspDisposeTask)
  523. pascal OSErr DSPInsertTask( DSPCPUDeviceParamBlkPtr theCPUDevice, 
  524.         DSPTaskRefNum theNewTaskRefNum, DSPPosition thePosition, 
  525.         DSPTaskPriority interruptLevel, DSPTaskRefNum theRelativeTaskRefNum )
  526.         = DSPDispatch(kdspInsertTask)
  527. pascal OSErr DSPRemoveTask( DSPTaskRefNum theTaskRefNum )
  528.         = DSPDispatch(kdspRemoveTask)
  529. pascal OSErr DSPTaskToSynchronize(DSPTaskRefNum theRefNum, unsigned long frameDelay, DSPSynchRefNum *synchRefNum)
  530.         = DSPDispatch(kdspTaskToSynchronize)
  531. pascal OSErr DSPSynchronizeTasks( DSPSynchRefNum *synchRefNum )
  532.         = DSPDispatch(kdspSynchronizeTasks)
  533. pascal OSErr DSPSetTaskActive (DSPTaskRefNum theRefNum)
  534.         = DSPDispatch(kdspSetTaskActive)
  535. pascal OSErr DSPSetTaskInactive (DSPTaskRefNum theRefNum)
  536.         = DSPDispatch(kdspSetTaskInactive)
  537. pascal OSErr DSPGetSection( DSPModuleRefNum theModuleRefNum, 
  538.         StringPtr theSectionName, DSPSectionRefNum *theSectionRefNum )
  539.         = DSPDispatch(kdspGetSection)
  540. pascal OSErr DSPNewFIFO (DSPSectionRefNum theSectionRefNum, 
  541.         DSPFIFORefNum *theFIFORefNum, unsigned long theSize, 
  542.         Ptr logical, Ptr physical, Boolean fifoFull,
  543.         MessageActionProc theInterrupt)
  544.         = DSPDispatch(kdspNewFIFO)
  545. pascal OSErr DSPDisposeFIFO (DSPSectionRefNum theSectionRefNum)
  546.         = DSPDispatch(kdspDisposeFIFO)
  547. pascal OSErr DSPGetSectionData (DSPSectionRefNum theSectionRefNum, Ptr *theData)
  548.         = DSPDispatch(kdspGetSectionData)
  549. pascal unsigned long DSPFIFORead (DSPFIFORefNum theFIFORefNum, Ptr theDestination, 
  550.         unsigned long theCount)
  551.         = DSPDispatch(kdspFIFORead)
  552. pascal unsigned long DSPFIFOWrite (DSPFIFORefNum theFIFORefNum, Ptr theSource, 
  553.         unsigned long theCount)
  554.         = DSPDispatch(kdspFIFOWrite)
  555. pascal unsigned long DSPFIFOGetReadCount (DSPFIFORefNum theFIFORefNum)
  556.         = DSPDispatch(kdspFIFOGetReadCount)
  557. pascal unsigned long DSPFIFOGetWriteCount (DSPFIFORefNum theFIFORefNum)
  558.         = DSPDispatch(kdspFIFOGetWriteCount)
  559. pascal unsigned long DSPFIFOGetSize (DSPFIFORefNum theFIFORefNum)
  560.         = DSPDispatch(kdspFIFOGetSize)
  561. pascal OSErr DSPFIFOClearInterrupt (DSPFIFORefNum theFIFORefNum)
  562.         = DSPDispatch(kdspFIFOClearInterrupt)
  563. pascal unsigned long DSPFIFOGetRefCon (DSPFIFORefNum theFIFORefNum)
  564.         = DSPDispatch(kdspFIFOGetRefCon)
  565. pascal OSErr DSPFIFOSetRefCon (DSPFIFORefNum theFIFORefNum, unsigned long theValue)
  566.         = DSPDispatch(kdspFIFOSetRefCon)
  567. pascal unsigned long DSPFIFOGetMessageMode (DSPFIFORefNum theFIFORefNum)
  568.         = DSPDispatch(kdspFIFOGetMessageMode)
  569. pascal OSErr DSPFIFOSetMessageMode (DSPFIFORefNum theFIFORefNum, 
  570.         unsigned long theFlags)
  571.         = DSPDispatch(kdspFIFOSetMessageMode)
  572. pascal unsigned long DSPManagerVersion(void)
  573.         = DSPDispatch(kdspManagerVersion)
  574. pascal OSErr DSPFIFOReset (DSPFIFORefNum theFIFORefNum)
  575.         = DSPDispatch(kdspFIFOReset)
  576. pascal OSErr DSPSetTaskRefCon (DSPTaskRefNum theRefNum, unsigned long theData)
  577.         = DSPDispatch(kdspSetTaskRefCon)
  578. pascal unsigned long DSPGetTaskRefCon (DSPTaskRefNum theRefNum)
  579.         = DSPDispatch(kdspGetTaskRefCon)
  580. pascal OSErr DSPGetIndexedClient (unsigned long theIndex, DSPCPUDeviceParamBlkPtr theCPUDevice, DSPClientRefNum *theClientRefNum)
  581.         = DSPDispatch(kdspGetIndexedClient)
  582. pascal OSErr DSPGetIndexedTask (unsigned long theIndex, DSPTaskPriority interruptLevel, DSPCPUDeviceParamBlkPtr theCPUDevice, DSPTaskRefNum    *theTaskRefNum)
  583.         = DSPDispatch(kdspGetIndexedTask)
  584. pascal OSErr DSPGetOwnerClient (DSPTaskRefNum theTaskRefNum, DSPClientRefNum *theClientRefNum)
  585.         = DSPDispatch(kdspGetOwnerClient)
  586. pascal OSErr DSPGetIndexedModule (unsigned long theIndex, DSPTaskRefNum theTaskRefNum, DSPModuleRefNum *theModuleRefNum)
  587.         = DSPDispatch(kdspGetIndexedModule)
  588. pascal OSErr DSPGetOwnerTask (DSPModuleRefNum theModuleRefNum, DSPTaskRefNum *theTaskRefNum)
  589.         = DSPDispatch(kdspGetOwnerTask)
  590. pascal OSErr DSPGetIndexedSection (unsigned long theIndex, DSPModuleRefNum theModuleRefNum, DSPSectionRefNum *theSectionRefNum)
  591.         = DSPDispatch(kdspGetIndexedSection)
  592. pascal OSErr DSPGetOwnerModule (DSPSectionRefNum theSectionRefNum, DSPModuleRefNum *theModuleRefNum)
  593.         = DSPDispatch(kdspGetOwnerModule)
  594. pascal OSErr DSPGetClientInfo (DSPClientInfoParamBlkHandle theClientParamBlkHdl)
  595.         = DSPDispatch(kdspGetClientInfo)
  596. pascal OSErr DSPGetTaskInfo (DSPTaskInfoParamBlkHandle theTaskParamBlkHdl)
  597.         = DSPDispatch(kdspGetTaskInfo)
  598. pascal OSErr DSPGetModuleInfo (DSPModuleInfoParamBlkHandle theModuleParamBlkHdl)
  599.         = DSPDispatch(kdspGetModuleInfo)
  600. pascal OSErr DSPGetSectionInfo (DSPSectionInfoParamBlkHandle theSectionParamBlkHdl)
  601.         = DSPDispatch(kdspGetSectionInfo)
  602. pascal OSErr DSPCountModule(DSPModuleRefNum theModuleRefNum)
  603.         = DSPDispatch(kdspCountModule)
  604. pascal OSErr DSPDontCountModule(DSPModuleRefNum theModuleRefNum)
  605.         = DSPDispatch(kdspDontCountModule)
  606. pascal OSErr DSPSetSkipCount(DSPModuleRefNum theModuleRefNum, unsigned long theCount)
  607.         = DSPDispatch(kdspSetSkipCount)
  608. pascal DSPTaskStatus DSPGetTaskStatus(DSPTaskRefNum theRefNum)
  609.         = DSPDispatch(kdspGetTaskStatus)
  610. pascal OSErr DSPSetCPUDeviceBondage( DSPCPUDeviceParamBlkPtr cpuDevice1, DSPCPUDeviceParamBlkPtr cpuDevice2 )
  611.         = DSPDispatch(kdspSetCPUDeviceBondage)
  612. pascal OSErr DSPFIFOSetMessageThreshold(DSPFIFORefNum theFIFORefNum, unsigned long theThreshold)
  613.         = DSPDispatch(kdspFIFOSetMessageThreshold)
  614. pascal OSErr DSPFIFOSwap (DSPFIFORefNum theFIFORefNum, unsigned long theSize, Ptr logical, Ptr physical, Boolean fifoFull, MessageActionProc theInterrupt)
  615.         = DSPDispatch(kdspFIFOSwap)
  616. pascal OSErr DSPSetGPBMode(DSPModuleRefNum theModuleRefNum, unsigned short desiredMode )
  617.         = DSPDispatch(kdspSetGPBMode)
  618. pascal OSErr DSPDontUpdateGPBPrefs (DSPModuleRefNum theModuleRefNum)
  619.         = DSPDispatch(kdspDontUpdateGPBPrefs)
  620. pascal OSErr DSPUpdateGPBPreferenceFile (DSPModuleRefNum theModuleRefNum)
  621.         = DSPDispatch(kdspUpdateGPBPreferenceFile)
  622. pascal OSErr DSPFIFOGetMessageActionProc (DSPFIFORefNum theFIFORefNum, MessageActionProc *theVector)
  623.         = DSPDispatch(kdspFIFOGetMessageActionProc)
  624. pascal OSErr DSPFIFOSetMessageActionProc (DSPFIFORefNum theFIFORefNum, MessageActionProc theVector)
  625.         = DSPDispatch(kdspFIFOSetMessageActionProc)
  626. pascal OSErr DSPGetAvailableOnChipMemory(DSPModuleRefNum theModuleRefNum, unsigned long *theSize)
  627.         = DSPDispatch(kdspGetAvailableOnChipMemory)
  628. pascal OSErr DSPSetSectionSize(DSPSectionRefNum theSectionRefNum, unsigned long theSize)
  629.         = DSPDispatch(kdspSetSectionSize)
  630. #endif
  631.